// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * PollAnswer generated by hbm2java
 */
@Entity
@Table(name = "poll_answer", catalog = "magento")
public class PollAnswer implements java.io.Serializable {

	private Integer answerId;
	private Poll poll;
	private String answerTitle;
	private int votesCount;
	private short answerOrder;
	private Set pollVotes = new HashSet(0);

	public PollAnswer() {
	}

	public PollAnswer(Poll poll, int votesCount, short answerOrder) {
		this.poll = poll;
		this.votesCount = votesCount;
		this.answerOrder = answerOrder;
	}

	public PollAnswer(Poll poll, String answerTitle, int votesCount,
			short answerOrder, Set pollVotes) {
		this.poll = poll;
		this.answerTitle = answerTitle;
		this.votesCount = votesCount;
		this.answerOrder = answerOrder;
		this.pollVotes = pollVotes;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "answer_id", unique = true, nullable = false)
	public Integer getAnswerId() {
		return this.answerId;
	}

	public void setAnswerId(Integer answerId) {
		this.answerId = answerId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "poll_id", nullable = false)
	public Poll getPoll() {
		return this.poll;
	}

	public void setPoll(Poll poll) {
		this.poll = poll;
	}

	@Column(name = "answer_title")
	public String getAnswerTitle() {
		return this.answerTitle;
	}

	public void setAnswerTitle(String answerTitle) {
		this.answerTitle = answerTitle;
	}

	@Column(name = "votes_count", nullable = false)
	public int getVotesCount() {
		return this.votesCount;
	}

	public void setVotesCount(int votesCount) {
		this.votesCount = votesCount;
	}

	@Column(name = "answer_order", nullable = false)
	public short getAnswerOrder() {
		return this.answerOrder;
	}

	public void setAnswerOrder(short answerOrder) {
		this.answerOrder = answerOrder;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pollAnswer")
	public Set getPollVotes() {
		return this.pollVotes;
	}

	public void setPollVotes(Set pollVotes) {
		this.pollVotes = pollVotes;
	}

}
